{include file='public/header.html'}
<div class="container-fluid">
    <div class="row">
        <div class="col-sm-3 col-md-2 sidebar" id="sidebar">
            {include file='public/sidebar.html'}
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main" id="main">
            <h3 class="page-header">留言管理</h3>

            <div class="panel panel-default">
                <div class="panel-heading">留言管理<span class="pull-right"><a href="javascript:history.back(-1);">返回</a></span></div>
                <div class="panel-body">
                    <button type="button" class="btn btn-success" onclick="actionConfirm('审核通过','{:url('state?params=status-1')}');">审核通过</button>
                    <button type="button" class="btn btn-info" onclick="actionConfirm('设为待审','{:url('state?params=status-0')}');">设为待审</button>
                    <button type="button" class="btn btn-danger" onclick="actionConfirm('删除', '{:url('del')}');">删除</button>
                </div>
                <div class="table-responsive">
                    <table class="table">
                        <thead>
                        <th width="50"><input type="checkbox" onclick="selectAll(this.checked)" /></th>
                        <th>ID</th>
                        <th>标题</th>
                        <th>留言者</th>
                        <th>回复</th>
                        <th>时间</th>
                        <th>状态</th>
                        <th>操作</th>
                        </thead>
                        <tbody>
                        {foreach $list as $vo}
                            <tr>
                                <td><input type="checkbox" name="ids" value="{$vo.id}" /> </td>
                                <td>{$vo.id}</td>
                                <td>{if $vo['is_top']==1:}[置顶]{/if}<a href="{:url('reply',['id'=>$vo['id']])}">{$vo.title}</a></td>
                                <td>{$vo.nickname}</td>
                                <td>{if $vo['reply_uid']>0:}<span class="label label-primary">已回复</span>{else:}<span class="label label-default">未回复</span>{/if}</td>
                                <td>{$vo.create_time|get_time_ago}</td>
                                <td>
                                    {if $vo['status']==1:}
                                    <a href="javascript:ajaxConfirm('{:url('state?params=status-0',['ids'=>$vo['id']])}','设为待审',2);" class="btn btn-xs btn-success">已审</a>
                                    {else:}
                                    <a href="javascript:ajaxConfirm('{:url('state?params=status-1',['ids'=>$vo['id']])}','审核通过',2);" class="btn btn-xs btn-danger">待审</a>
                                    {/if}

                                </td>
                                <td>
                                    <a href="javascript:ajaxConfirm('{:url('del',['ids'=>$vo['id']])}','删除',2);" class="btn btn-xs btn-danger">删除</a>
                                </td>
                            </tr>
                        {/foreach}
                        </tbody>
                    </table>
                </div>
                <div class="panel-footer">{$list->links()}</div>
            </div>
        </div>
    </div>
</div>
{include file='public/footer.html'}
</body>
</html>
